#include "3DPoint.h"

C3DPoint::C3DPoint(void)
{
	m_x=m_y=m_z=0;
	m_u=m_v=0;
}

C3DPoint::C3DPoint( const C3DPoint& p)
{
	m_x=p.m_x;
	m_y=p.m_y;
	m_z=p.m_z;
	m_u=p.m_u;
	m_v=p.m_v;
}

C3DPoint::C3DPoint( GLfloat x,GLfloat y,GLfloat z )
{
	m_x=x;
	m_y=y;
	m_z=z;
}

C3DPoint::C3DPoint( GLfloat x,GLfloat y,GLfloat z,GLfloat u, GLfloat v )
{
	m_x=x;
	m_y=y;
	m_z=z;
	m_u=u;
	m_v=v;
}

C3DPoint::~C3DPoint(void)
{
}

C3DPoint& C3DPoint::operator=( const C3DPoint& p)
{
	if(this==&p)
		return *this;
	m_x=p.m_x;
	m_y=p.m_y;
	m_z=p.m_z;
	m_u=p.m_u;
	m_v=p.m_v;
}

C3DPoint C3DPoint::operator+( const C3DPoint& p ) const
{
	C3DPoint newP;
	newP.m_x=m_x+p.m_x;
	newP.m_y=m_y+p.m_y;
	newP.m_z=m_z+p.m_z;
	return newP;
}

C3DPoint C3DPoint::operator-( const C3DPoint& p ) const
{
	C3DPoint newP;
	newP.m_x=m_x-p.m_x;
	newP.m_y=m_y-p.m_y;
	newP.m_z=m_z-p.m_z;
	return newP;
}
C3DPoint C3DPoint::operator*( const int& s ) const
{
	C3DPoint newP;
	newP.m_x=m_x*s;
	newP.m_y=m_y*s;
	newP.m_z=m_z*s;
	return newP;
}

void C3DPoint::SetPoint( GLfloat x, GLfloat y, GLfloat z )
{
	m_x = x; 
	m_y = y;
	m_z = z;
}
